<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div></div>
    <script>
        var div = document.querySelector("div")
        //1.获取url中的location.search参数
        var name = location.search  //获取为?uname=red
        //2.通过substr来截取自己想要的字符串部分 substr(开始截取位置，截取位数)
        var newn = name.substr(1) //返回uname=red
        //3.通过split来拆分字符串
        var lname = newn.split('=')
        div.innerHTML = '欢饮' + lname[1]
    </script>
</body>
</html>